package org.compression.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.model.business.AudioContent;
import org.model.business.AudioContent;
import org.model.comm.Page;
@Mapper
public interface AudioContentMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AudioContent record);

    int insertSelective(AudioContent record);

    AudioContent selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AudioContent record);

    int updateByPrimaryKey(AudioContent record);
    
    @Select("select * from audio_content limit #{currentPageNum},#{pageSize}")
 	public List<AudioContent> getPageAudioContent(Page mPage);
    
    
    @Select("select count(*) from audio_content")
 	public long getTotal();

    @Select("select * from audio_content where name like CONCAT('%',#{name},'%') ")
	public List<AudioContent> selectName(AudioContent mAudioContents);
    
    @Insert("insert into audio_content (name) values (#{name})")
    @Options(useGeneratedKeys=true, keyProperty="id", keyColumn="id")
    public int insertAudioContent(AudioContent mAudioContent); 
  
    @Insert("insert into audio_content (name,createdate,attr) values (#{name},#{createdate},#{attr})")
    @Options(useGeneratedKeys=true, keyProperty="id", keyColumn="id")
    public int insertAudioContentDate(AudioContent mAudioContent); 
    
    
    @Select("select * from  audio_content  where uuid=#{createdate}")
    public AudioContent selectCreateTime(String createdate); 
    
    
    @Select("select id from  audio_content  where attr=#{attr}")
    public  List<Integer> selectUUID(String attr); 
    
    
    @Select("select path from  audio_content  where page=#{page} and audio_attr_id=#{audioAttrId}")
    public  List<String> selectPath(@Param("page")String page,@Param("audioAttrId")String  audioAttrId); 
    
    
    
    
    
    
   /* 
    @Select("select path from  audio_content  where page=#{page} and audio_attr_id=#{audioAttrId}")
    public  List<String> selectPath(@Param("page")String page,@Param("audioAttrId")String  audioAttrId); 
    
    */
    
    
    
}